<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>English book village_Back office</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="font.css" rel="stylesheet" type="text/css">
<link href="office.css" rel="stylesheet" type="text/css">
<script src="lib.js" language="javascript"></script>
<style type="text/css">
<!--
.style1 {color: #666666}
-->
</style>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr> 
<td height="30" background="images/pop_title_bg.gif" class="font"><img src="images/pop_title.gif" width="82" height="24"></td>

</tr>
<tr> 
<td height="3" bgcolor="#000000"><img src="images/1blank.gif" width="1" height="1"></td>
</tr>
<tr> 
<td height="10"></td>
</tr>
<tr> 
<td align="center"><table width="100%" border="2" cellspacing="0" cellpadding="3" bordercolor="#CCCCCC" class="font" style="border-collapse:collapse;" rules="rows" frame="hsides">
<tr>
<form name="frm">
<td><div align="left">년도 선택</div></td>
<td><div align="left">
<select name="year" class="font" id="year">
<?php 
    $startYear = $_GET['year'] ? $_GET['year'] : date('Y'); 
    $endYear = date('Y')+5; 

    for($i=$startYear;$i<=$endYear;$i++) {
        echo '<option value="'.$i.'" '; 
        if($i == $_GET['year']) {
            echo 'selected = "selected"';
        }
        echo '>'.$i.'년'; 
    }
?>
</select>
</div></td>

</tr>
<tr>
<td width="130"><div align="left">월 선택</div></td>
<td><div align="left">
<select name="month" class="font" id="month">
<?php 
    for($i=1;$i<=12;$i++) {
        echo '<option value="'.$i.'" '; 
        if($i == $_GET['month']) {
            echo 'selected = "selected"';
        }
        echo '>'.$i.'월'; 
    }
?>
</select>
</div></td>
</tr>
<tr>
<td><div align="left">요일 선택</div></td>
<td><div align="left">
월 <input type="checkbox" name="week" value="월"> / 
화 / <input type="checkbox" name="week" value="화">수 /
<input type="checkbox" name="week" value="수">목 /
<input type="checkbox" name="week" value="목">금 /
<input type="checkbox" name="week" value="금"> 
</div></td>
</tr>
<tr>
<td><div align="left">시간 선택(시작시간)</div></td>
<td><div align="left">
<label></label>
오전
<label>
<input name="ampm" type="radio" value="am" checked>
</label>
/ 오후
<input name="ampm" type="radio" value="pm">

<input name="starttime" type="text" class="font" value="1" size="2" maxlength="2"> 
시 <span class="style1"><br>
*모든 수업은 시작 해서 60분 수업을 기준합니다. </span></div></td>
</tr>
</table></td>
<script>
    function submitParent(obj) {
        var starttime = parseInt(obj.starttime.value); 
        opener.document.coursefrm.year.value = obj.year.value; 
        opener.document.coursefrm.month.value = obj.month.value; 
        starttime = getRadioValue(obj.ampm) == "am" ? starttime : starttime+12; 
        opener.document.coursefrm.starttime.value = starttime;
        var weekArray = getCheckboxArray(obj.week);
        opener.document.coursefrm.weekArray.value = weekArray.join(','); 
        opener._renderDesc();
        self.close(); 
        return true; 
    }

    function getCheckboxArray(obj) {
       var _length = obj.length;
       var _array = new Array(); 
       var count=0; 
        for(var i=0;i<_length;i++) {
            if(obj[i].checked) {
                _array[count] = obj[i].value;
                count++; 
            }
        }
        return _array; 
    }
</script>
</tr>
<tr>
<td align="center">&nbsp;</td>
</tr>
<tr> 
<td align="center">
<input type="button" class="font" value="등록" onClick="javascript:submitParent(document.frm);"> 
<input type="button" type="button" class="font" id="button" value="취소" onclick="javascript:self.close();"></td>
</tr>
</form>
</table>
</body>
</html>
